package org.dromara.oce.domain.dto;

import cn.hutool.core.util.NumberUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.dromara.oce.utils.PlatformParamTransUtil;
import org.springframework.util.ObjectUtils;

import java.math.BigDecimal;
import java.math.RoundingMode;

@Data
@Slf4j
public class OceEverydayCostHoursDTO {

	//@ApiModelProperty(value = "当日时间戳")
	private Long thatdayTimestamp;

	//@ApiModelProperty(value = "当日日期")
	private String thatdayDate;

	//@ApiModelProperty(value = "当日某时时间戳yyyy-mm-dd HH")
	private Long thatdayHoursTimestamp;

	//@ApiModelProperty(value = "当日某时时间")
	private String thatdayHoursDate;


	//@ApiModelProperty(value = "总消耗")
	private BigDecimal cost = BigDecimal.ZERO;

	//@ApiModelProperty(value = "展示数")
	@TableField(value = "`show`")
	private Integer show = 0;

	//@ApiModelProperty(value = "平均千次展现费用=总花费/展示数*1000")
	@TableField(value = "avg_show_cost")
	private BigDecimal avgShowCost = BigDecimal.ZERO;

	//@ApiModelProperty(value = "点击数")
	private Integer click = 0;

	//@ApiModelProperty(value = "平均点击单价=总花费/点击数")
	private BigDecimal avgClickCost = BigDecimal.ZERO;

	//@ApiModelProperty(value = "点击率=点击数/展示数*100%")
	private BigDecimal ctr = BigDecimal.ZERO;

	//@ApiModelProperty(value = "转化数=付费数*回传率")
	@TableField(value = "`convert`")
	private Integer convert = 0;

	//@ApiModelProperty(value = "转化成本")
	private BigDecimal convertCost = BigDecimal.ZERO;

	//@ApiModelProperty(value = "转化率=转化数/点击数*100%")
	private BigDecimal convertRate = BigDecimal.ZERO;

	//@ApiModelProperty(value = "激活数")
	private Integer active = 0;

	//@ApiModelProperty(value = "激活成本=总消耗/激活数")
	private BigDecimal activeCost = BigDecimal.ZERO;

	//@ApiModelProperty(value = "激活率=激活数/点击数*100%")
	private BigDecimal activeRate = BigDecimal.ZERO;

	//@ApiModelProperty(value = "首次付费数")
	private Integer activePay = 0;

	//@ApiModelProperty(value = "首次付费成本=消耗/付费次数")
	private BigDecimal activePayCost = BigDecimal.ZERO;

	//@ApiModelProperty(value = "首次付费率=首次付费数/激活数")
	private BigDecimal activePayRate = BigDecimal.ZERO;

	//@ApiModelProperty(value = "付费次数")
	private Integer gamePayCount = 0;

	//@ApiModelProperty(value = "付费成本=消耗/付费次数")
	private BigDecimal gamePayCost = BigDecimal.ZERO;

	//@ApiModelProperty(value = "当日总收入")
	private BigDecimal thatdayTotalAmount = BigDecimal.ZERO;

	//@ApiModelProperty("当日分成金额")
	private BigDecimal thatdayDividendAmount = BigDecimal.ZERO;

	//@ApiModelProperty("当日利润金额=当日分成金额-当日消耗")
	private BigDecimal thatdayProfitAmount = BigDecimal.ZERO;

	//@ApiModelProperty(value = "当日总支付笔数")
	private Integer thatdayPaidTotalNum = 0;

	//@ApiModelProperty(value = "当日付款人数")
	private Integer thatdayPaidUseNum = 0;

	//@ApiModelProperty(value = "当日IAA总收入")
	private BigDecimal iaaTotalAmount = BigDecimal.ZERO;

	//@ApiModelProperty(value = "当日IAA分成金额")
	private BigDecimal iaaDividendAmount = BigDecimal.ZERO;

    /**
     * 当日注册用户的IAA总收入
     */
    private BigDecimal iaaRegisterTotalAmount = BigDecimal.ZERO;

    /**
     * 当日注册用户的IAA分成金额
     */
    private BigDecimal iaaRegisterDividendAmount = BigDecimal.ZERO;

    /**
     * 当日注册用户的总收入
     */
    private BigDecimal thatdayRegisterTotalAmount = BigDecimal.ZERO;

    /**
     * 当日注册用户的分成金额
     */
    private BigDecimal thatdayRegisterDividendAmount = BigDecimal.ZERO;


	/**
	 * IAP回本率 = 总分成金额 / 总消耗金额
	 * IAA回本率=（总分成金额+广告总分成金额）/总消耗金额
	 */
	private BigDecimal extRecoveryRate = BigDecimal.ZERO;

	/**
	 * IAP客单价 = 当日充值分成金额 / 付费人数
	 * IAA客单价 = 当日广告分成 / 转化数
	 */
	private BigDecimal extAvgPrice = BigDecimal.ZERO;

	/**
	 * IAP付费成本 = 消耗 / 付费人数
	 * IAA付费成本 = 消耗 / 激活数
	 */
	private BigDecimal extPayCost = BigDecimal.ZERO;

    /**
     * 回传率
     * 回传率 = 转化数 / 当日付款人数
     */
    private BigDecimal returnRate = BigDecimal.ZERO;

}
